import request from '@/utils/request'
// 红外配置的接口

interface paramsData {
  $select: string;
}
interface updateData {
  frequency: number,
  color: string,
  id: number
}
interface searchData {
  startTime?: string,
  endTime?: string,
  maxResultCount?: number,
  skipCount?: number
}

// 获取红外设置信息
export function getInfraredSetDataApi (data?: paramsData) {
  return request({
    // url: '/api1/api/services/app/InfSettingsService/GetInfTemperSetting',
    url: '/api1/api/app/infrared/infTemperSetting',
    method: 'get',
    data: data
  })
}

// 修改红外设置信息
export function updateInfraredSetDataApi (data: updateData) {
  return request({
    // url: '/api1/api/services/app/InfSettingsService/Update',
    url: '/api1/api/app/infrared',
    method: 'put',
    data: data
  })
}

// 获取红外巡航任务记录数据
export function getInfraredMissionListApi () {
  return request({
    // url: '/api1/api/services/app/InfTemperHistoryService/GetCurrentInfTemperTask',
    url: '/api1/api/app/infrared/currentInfTemperTask',
    method: 'get'
  })
}

// 获取煤场温度信息
export function getCoalYardTemperatureApi () {
  return request({
    url: '/api1/api/services/app/InfTemperHistoryService/GetCurrentInfTempers',
    method: 'get'
  })
}

// 搜索红外巡航任务记录数据
export function searchInfraredMissionListApi (data: searchData) {
  return request({
    // url: '/api1/api/services/app/InfTemperHistoryService/SearchInfTemperTasks',
    url: '/api1/api/app/infrared/infTemperTasks',
    method: 'get',
    // data: data,
    params: data
  })
}

// 获取单条红外巡航任务记录数据
export function getInfraredMissionDetailApi (data:{Id:string}) {
  return request({
    // url: '/api1/api/services/app/InfTemperHistoryService/GetInfTemperHisByTask',
    url: `/api1/api/app/infrared/${data.Id}/infTemperHisByTask`,
    method: 'get'
  })
}

// 获取红外图
export function getInfraredImageApi (data:any) {
  return request({
    url: '/api1/api/app/infrared/infHistoryLast',
    method: 'get',
    params: data
  })
}

// 获取红外历史曲线数据
export function getInfraredHistoryApi (data: any) {
  return request({
    // url: '/api1/api/app/infrared/infHistorucalData',
    url: '/api1/api/app/infrared/infHistoricalData', 
    method: 'get',
    params: data
  })
}